home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / System Software / System Extensions / AppleScript Beta / Development Tools / Interfaces / CIncludes / OSAGeneric.h < prev   
Encoding:
Text File  |  1992-11-25  |  3.9 KB  |  91 lines  |  [TEXT/MPS ]

  1. ////////////////////////////////////////////////////////////////////////////////
  2. // OPEN SCRIPTING ARCHITECTURE: Generic Component Interface
  3. ////////////////////////////////////////////////////////////////////////////////
  4. // Copyright © 1992 Apple Computer, Inc. All rights reserved.
  5. // Authors: Jens Alfke, William Cook, Donn Denman, and Warren Harris
  6. ////////////////////////////////////////////////////////////////////////////////
  7. // This interface defines a "generic scripting component."
  8. // The Generic Scripting Component allows automatic dispatch to a
  9. // specific scripting component that conforms to the OSA interface.
  10. // This component supports OSA, by calling AppleScript or some other 
  11. // scripting component.  Additionally it provides access to the default
  12. // and the user-prefered scripting component.
  13. ////////////////////////////////////////////////////////////////////////////////
  14.  
  15. #ifndef __OSAGeneric__
  16. #define __OSAGeneric__
  17.  
  18. #ifndef __OSA__
  19. #include "OSA.h"
  20. #endif
  21.  
  22. #define errOSAComponentIndeterminate    -1760    // Can't determine proper component from parameters
  23. #define errOSAComponentMismatch            -1761    // Parameters are from 2 different components
  24. #define errOSACantOpenComponent            -1762    // Can't connect to scripting system with that ID
  25.  
  26. #define kGenericComponentVersion    0x0060
  27.  
  28. #define    kGSSSelectGetDefaultScriptingSystem        0x1001        // == kOSASelectComponentSpecificStart
  29. #define    kGSSSelectSetDefaultScriptingSystem        0x1002
  30. #define    kGSSSelectGetScriptingComponent            0x1003
  31. #define    kGSSSelectGetScriptingSystemFromStored    0x1004
  32. #define kGSSSelectGenericToRealID                0x1005
  33. #define kGSSSelectRealToGenericID                0x1006
  34. #define kGSSSelectMakeGenericContext            0x1007
  35. #define kGSSSelectOutOfRange                    0x1008
  36.  
  37. typedef OSType            ScriptSystemSelector;
  38. typedef OSAID            GenericID;
  39. typedef AEDesc            OSAStoredScript;
  40.  
  41. // get and set the default scripting system
  42. pascal OSAError 
  43. GetDefaultScriptingSystem( ComponentInstance genericScriptingSystem,
  44.                             ScriptSystemSelector* scriptingSubType)            // out
  45.                     = ComponentCallNow(kGSSSelectGetDefaultScriptingSystem, 4);
  46.     
  47. pascal OSAError 
  48. SetDefaultScriptingSystem( ComponentInstance genericScriptingSystem,
  49.                             ScriptSystemSelector scriptingSubType)            // in
  50.                     = ComponentCallNow(kGSSSelectSetDefaultScriptingSystem, 4);
  51.  
  52. // get a scripting system component instance from its subtype code
  53. pascal OSAError 
  54. GetScriptingComponent( ComponentInstance genericScriptingSystem,
  55.                         ScriptSystemSelector scriptingSubType,                 // in
  56.                         ComponentInstance* scriptingInstance)                // out
  57.                     = ComponentCallNow(kGSSSelectGetScriptingComponent, 8);
  58.  
  59. // get a scripting system selector from a stored script
  60. pascal OSAError 
  61. GetScriptingSystemFromStored( ComponentInstance genericScriptingSystem,
  62.                                 const OSAStoredScript *scriptData,             // in
  63.                                 ScriptSystemSelector* scriptingSubType)        // out
  64.                     = ComponentCallNow(kGSSSelectGetScriptingSystemFromStored, 8);
  65.  
  66. // get a real component instance and script id from a generic id
  67. pascal OSAError 
  68. GenericToRealID( ComponentInstance genericScriptingSystem,
  69.                         OSAID *theGenericScriptID,                            // in/out
  70.                         ComponentInstance *theExactComponent )                // out
  71.                     = ComponentCallNow(kGSSSelectGenericToRealID, 8);
  72.  
  73. // get a generic id from a real component instance and script id
  74. pascal OSAError 
  75. RealToGenericID( ComponentInstance genericScriptingSystem,
  76.                         OSAID *theRealScriptID,                                // in/out
  77.                         ComponentInstance theExactComponent )                // in
  78.                     = ComponentCallNow(kGSSSelectRealToGenericID, 8);
  79.  
  80. // get a generic id from a real component instance and script id
  81. pascal OSAError 
  82. MakeGenericContext( ComponentInstance genericScriptingSystem,
  83.                         const AEDesc *contextName,                            // in
  84.                         GenericID scriptID,                                    // in
  85.                         GenericID *contextID )                                // out
  86.                     = ComponentCallNow(kGSSSelectMakeGenericContext, 12);
  87.  
  88. #endif    // ifdef __GenericComponent__
  89. //////////////////////////////////////////////////////////////////////////////////////////////////////
  90.  
  91.